package college.dao;

import java.util.Date;

/**
 * AttendanceId entity. @author MyEclipse Persistence Tools
 */

public class AttendanceId implements java.io.Serializable {

	// Fields

	private Date date;
	private Integer hour;
	private Student student;

	// Constructors

	/** default constructor */
	public AttendanceId() {
	}

	/** full constructor */
	public AttendanceId(Date date, Integer hour, Student student) {
		this.date = date;
		this.hour = hour;
		this.student = student;
	}

	// Property accessors

	public Date getDate() {
		return this.date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public Integer getHour() {
		return this.hour;
	}

	public void setHour(Integer hour) {
		this.hour = hour;
	}

	public Student getStudent() {
		return this.student;
	}

	public void setStudent(Student student) {
		this.student = student;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof AttendanceId))
			return false;
		AttendanceId castOther = (AttendanceId) other;

		return ((this.getDate() == castOther.getDate()) || (this.getDate() != null
				&& castOther.getDate() != null && this.getDate().equals(
				castOther.getDate())))
				&& ((this.getHour() == castOther.getHour()) || (this.getHour() != null
						&& castOther.getHour() != null && this.getHour()
						.equals(castOther.getHour())))
				&& ((this.getStudent() == castOther.getStudent()) || (this
						.getStudent() != null && castOther.getStudent() != null && this
						.getStudent().equals(castOther.getStudent())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getDate() == null ? 0 : this.getDate().hashCode());
		result = 37 * result
				+ (getHour() == null ? 0 : this.getHour().hashCode());
		result = 37 * result
				+ (getStudent() == null ? 0 : this.getStudent().hashCode());
		return result;
	}

}